home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
yatzys_1
/
yatzy.frm
< prev
next >
Wrap
Text File
|
1998-10-22
|
25KB
|
823 lines
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmYatzy
BackColor = &H00C0FFFF&
BorderStyle = 1 'Fixed Single
Caption = "Yatzy"
ClientHeight = 5340
ClientLeft = 90
ClientTop = 1380
ClientWidth = 9090
Icon = "yatzy.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 356
ScaleMode = 3 'Pixel
ScaleWidth = 606
StartUpPosition = 2 'CenterScreen
Begin MSFlexGridLib.MSFlexGrid grdScoreBoard
Height = 4665
Left = 240
TabIndex = 0
Top = 240
Width = 5085
_ExtentX = 8969
_ExtentY = 8229
_Version = 65541
Rows = 19
Cols = 11
FixedRows = 0
FixedCols = 0
BackColorBkg = 12632256
Redraw = -1 'True
Enabled = -1 'True
HighLight = 0
GridLinesFixed = 1
ScrollBars = 0
End
Begin VB.PictureBox picDice
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Index = 4
Left = 7320
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 6
Top = 3240
Width = 480
End
Begin VB.PictureBox picDice
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Index = 3
Left = 6600
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 5
Top = 3240
Width = 480
End
Begin VB.PictureBox picDice
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Index = 2
Left = 7680
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 4
Top = 2520
Width = 480
End
Begin VB.PictureBox picDice
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Index = 1
Left = 6960
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 3
Top = 2520
Width = 480
End
Begin VB.PictureBox picDice
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
BorderStyle = 0 'None
DrawStyle = 5 'Transparent
FillStyle = 0 'Solid
ForeColor = &H00FFFFFF&
Height = 480
Index = 0
Left = 6240
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 2
Top = 2520
Width = 480
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 50
Left = 5520
Top = 4320
End
Begin VB.CommandButton cmdHitMe
Height = 735
Left = 6120
TabIndex = 1
Top = 4080
Width = 2175
End
Begin VB.Image imgNumber
Appearance = 0 'Flat
Height = 480
Index = 5
Left = 8400
Picture = "yatzy.frx":030A
Top = 600
Width = 480
Visible = 0 'False
End
Begin VB.Image imgNumber
Appearance = 0 'Flat
Height = 480
Index = 4
Left = 7800
Picture = "yatzy.frx":03DD
Top = 600
Width = 480
Visible = 0 'False
End
Begin VB.Image imgNumber
Appearance = 0 'Flat
Height = 480
Index = 3
Left = 7200
Picture = "yatzy.frx":04AC
Top = 600
Width = 480
Visible = 0 'False
End
Begin VB.Image imgNumber
Appearance = 0 'Flat
Height = 480
Index = 2
Left = 6600
Picture = "yatzy.frx":0577
Top = 600
Width = 480
Visible = 0 'False
End
Begin VB.Image imgNumber
Appearance = 0 'Flat
Height = 480
Index = 1
Left = 6000
Picture = "yatzy.frx":063B
Top = 600
Width = 480
Visible = 0 'False
End
Begin VB.Image imgNumber
Appearance = 0 'Flat
Height = 480
Index = 0
Left = 5400
Picture = "yatzy.frx":06F9
Top = 600
Width = 480
Visible = 0 'False
End
Begin VB.Menu mnuYatzy
Caption = "&Spel"
Begin VB.Menu mnuAbout
Caption = "&Om"
End
Begin VB.Menu mnuHighScore
Caption = "&High-Score"
End
Begin VB.Menu mnuNewGame
Caption = "&Nytt-Spel"
End
Begin VB.Menu mnuSound
Caption = "&Ljud"
Checked = -1 'True
End
Begin VB.Menu mnuRestart
Caption = "&Starta-Om (Ctrl+click)"
End
Begin VB.Menu mnuRegret
Caption = "&┼ngra"
End
Begin VB.Menu mnuExit
Caption = "&Avsluta"
End
End
End
Attribute VB_Name = "frmYatzy"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'-------------------------------------------------------------------------
'Code by: Anders Fransson
'Email: anders.fransson@home.se
'Internet: http://hem1.passagen.se/fylke
'Date: 97-07-25
'-------------------------------------------------------------------------
Option Explicit
Private msPlayer(4) As String 'Players name
Private miBonusSum(4) As Integer 'Bonus sum for player
Private miTotalSum(4) As Integer 'Total sum for player
Private miOneToSix(4) As Integer 'Nr of clicks in the 1 to 6 rows for player
Private miRoundSum As Integer 'Sum for a round
Private miPlayer As Integer 'Index of player (1-5)
Private miNrOfPlayers As Integer 'Nr of players (1-5)
Private miThrows As Integer 'Nr of throws for a player (0-3)
Private miThrowsIfRegret As Integer 'The last nr of throws for a player (1-3)
Private miRound As Integer 'Round to play (0-10 if single player)
Private miClickedRows As Integer 'Nr of clicked rows (0-15) for last player
Private miLastClickedRow As Integer 'The last clicked row
Private mbNewGame As Boolean 'True if new game is selected
Public mbGameNotStarted As Boolean 'True if game not is started
Const COLUMN_WIDTH As Integer = 420
Const MAX_PLAYERS As Integer = 5
Const DICE_MOVE As Integer = 150
'Text constants
Const TEXT_HIT_DICES As String = "slσ med tΣrningarna"
Const TEXT_TWO_LEFT As String = "tvσ gσnger till"
Const TEXT_ONE_LEFT As String = "en gσng till"
Const TEXT_CLICK